<template>
  <div class="home">
    <hello-world msg="Welcome to Your Vue.js" />
    <van-button type="primary">主要按钮</van-button>
    <van-rate v-model="value" />
  </div>
</template>

<script lang="ts" setup>
import { Button, Rate } from 'vant';

//因为这里用了script的setup方式就用不到 defineComponent 这个定义组件的api了
import { useSlots, useAttrs, defineProps, onMounted, watchEffect, ref } from 'vue';
// 跳路由用
//import router from '@/router/index';
// 获取路由参数
//import { useRoute } from 'vue-router';
// const route = useRoute();
// const slots = useSlots();
// const attrs = useAttrs();

//import HelloWorld from '@/components/HelloWorld.vue'; // @ is an alias to /src

const value = ref(3);

onMounted(() => {
  console.log('onMounted:', 222222);
});

//watchEffect 会最先执行
watchEffect(() => {
  console.log('watchEffect:', 3333);
});
</script>
